// 中划线转驼峰
export function dash2Camel(str: string) {
    return str.replace(/-(\w)/g, (_, letter) => letter.toUpperCase());
}

// 驼峰转中划线
export function camel2Dash(str?: string) {
    if(!str) return str;
    return str.replace(/([A-Z])/g, "-$1").toLowerCase();
}